<?php
	define("TITLE_PREFIX", "EIPV | ");
	define("DEFAULT_TITLE", "Evidencia a Inventarizácia Prístrojového Vybavenia");
	
	error_reporting(0);
	
	$GLOBALS["title"] = TITLE_PREFIX.DEFAULT_TITLE;
	
	include_once 'constants.php';  
	
	define('ALLOW_DEBUG', true);
	define('TEST_MODE', true);
	
	// define introduction page
	define('STARTING_PAGE', 'login');
	
	// define resource directories
	define('WORKING_DIR', '/TIS/');
	define('URL_HOME', 'http://'.$_SERVER['HTTP_HOST'].constant('WORKING_DIR'));
	
	define('ROOT_DIR', $_SERVER['DOCUMENT_ROOT'].constant('WORKING_DIR'));
	
	define('TEMPLATE_DIR', 'templates/');
	define('BASE_DIR', 'base/');
	define('MODEL_DIR', 'models/');
	define('RESOURCE_DIR', 'resources/');
	define('IMAGE_DIR', constant('RESOURCE_DIR').'images/');
	define('PLUGIN_DIR', constant('RESOURCE_DIR').'plugins/');
	define('PHP_PLUGIN_DIR', constant('PLUGIN_DIR').'php/');
	define('JS_PLUGIN_DIR', constant('PLUGIN_DIR').'js/');
	define('EXT_RESOURCE_DIR', constant('URL_HOME').'resources/');
	define('EXT_IMAGE_DIR', constant('EXT_RESOURCE_DIR').'images/');
	define('EXT_JS_PLUGIN_DIR', constant('EXT_RESOURCE_DIR').'plugins/js/');
	define('EXT_TEMPLATE_DIR', constant('URL_HOME').'templates/');
	define('EXT_MODEL_DIR', constant('URL_HOME').'models/');
	
	
	// Load base classes
	require(constant('BASE_DIR').'baseController.php');
	require(constant('BASE_DIR').'baseDataAccess.php');
	require(constant('BASE_DIR').'baseModel.php');
	require(constant('BASE_DIR').'general.php');
	
	// Load Models
	general::includeDir(constant('MODEL_DIR'));	
	general::includeDir('../'.constant('MODEL_DIR'));	
	
	// Load plugins
	require(constant('PHP_PLUGIN_DIR').'Smarty-3.0.8/Smarty.class.php');
	define('SMARTY_CACHE_DIR', constant('ROOT_DIR').'/cache');
	define('SMARTY_COMPILE_DIR', constant('ROOT_DIR').'/compiled');
	
	// Load modified smarty
	require(constant('RESOURCE_DIR').'my_smarty.php');
	
	// DB settings;
	define('DB_SERVER','localhost');
	define('DB_USER','eipv');
	define('DB_PASSWORD','31pvSign');
	define('DB_NAME','eipv');
	
	// prohibit some modules from unauthorized access
	$prohibited_templates = array('debug/debug');
	$GLOBALS['PROHIBITED_TEMPLATES'] = $prohibited_templates;
	
	// or redirect others
	$redirect_templates = array();
	$GLOBALS['REDIRECT_TEMPLATES'] = $redirect_templates;

	
?>